package plant_package;

import java.util.Map;

import utilities_package.Debug;

public class GeneralPlant implements PlantInterface {

	@Override
	public int computeLivingCount(int count,
			Map<String, Integer> resourceAssignment) {
		
		double rate = getMaxGrowRate();
		double times = 1 + rate;
		for (String resource : resourceAssignment.keySet())
		{
			double supply = resourceAssignment.containsKey(resource) ? resourceAssignment.get(resource) : 0.0;
			double shortage = computeResourceDemand(count, resource) - supply;
			if (shortage < 0) 
			{
				Debug.pi_warning("negative shorage!");
				shortage = 0;
			}
			
			times *= Math.exp(- shortage / );
		}
		
		int limit = getAmountLimit();
		
		double reverse = 1 / double(1 + rate);
		times *= reverse + (1 - reverse) * Math.exp(-  
		
		return 0;
	}
	
	public double getMaxGrowRate()
	{
		Debug.pi_panic("Don't use superclass");
		return 0;
	}
	
	public int getAmountLimit()
	{
		Debug.pi_panic("Don't use superclass");
		return 0;
	}

	@Override
	public Integer computeResourceDemand(int count, String resource) {
		Debug.pi_panic("Don't use superclass");
		return null;
	}

	@Override
	public Integer computeResourcePressure(int count, String resource) {
		Debug.pi_panic("Don't use superclass");
		return null;
	}

	@Override
	public String getName() {
		Debug.pi_panic("Don't use superclass");
		return null;
	}

}
